Pytorch中cudnn版本查询

问题:

Disable or able cudnn,查询版本。

Disable cudnn for batch_norm: (See: @Microsoft / human-pose-estimation.pytorch#installation)

# PYTORCH=/path/to/pytorch
# for pytorch v0.4.0
sed -i "1194s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py
# for pytorch v0.4.1
sed -i "1254s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py

# Note that instructions like # PYTORCH=/path/to/pytorch indicate that you should pick 
# a path where you'd like to have pytorch installed and then set an environment
# variable (PYTORCH in this case) accordingly.

For other pytorch version

import torch
print(torch.backends.cudnn.version())

对我来说
7501
所以,
sed -i "7501s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py

 

posted @ 2019-06-20 13:55  月亮下,六便士  阅读(4594)  评论(2编辑  收藏  举报